package com.yowasa.xiuxian.engine.hone.special;

import com.yowasa.xiuxian.annoations.SE;
import com.yowasa.xiuxian.engine.hone.SpecialInterface;
import com.yowasa.xiuxian.entity.bo.user.UserBO;
import com.yowasa.xiuxian.entity.bo.user.UserBattle;
import com.yowasa.xiuxian.entity.enums.ElementEnum;
import com.yowasa.xiuxian.entity.enums.StageEnum;
import com.yowasa.xiuxian.exception.HandlerException;
import com.yowasa.xiuxian.service.helper.UserTagHelper;
import org.springframework.beans.factory.annotation.Autowired;

@SE(name = "轮回体")
public class LunHuiTi implements SpecialInterface {

    @Autowired
    private UserTagHelper userTagHelper;

    @Override
    public ElementEnum getElement() {
        return null;
    }

    @Override
    public void limit(UserBO user) {
        if (user.getStage() < StageEnum.YUAN_YING.getLevel()) {
            throw new HandlerException("学习/使用轮回体必须要流幻之铂以上");
        }
    }

    @Override
    public String limitDesc() {
        return "轮回者";
    }

    @Override
    public String desc() {
        return "修习之后提高10%的全战斗属性";
    }

    @Override
    public void effectBattle(UserBO userBO,UserBattle userBattle) {
        userBattle.setHp((int) (userBattle.getHp() + userBO.getUserOriginBattle().getHp() * 0.1));
        userBattle.setMp((int) (userBattle.getMp() + userBO.getUserOriginBattle().getMp() * 0.1));
        userBattle.setAtk((int) (userBattle.getAtk() + userBO.getUserOriginBattle().getAtk() * 0.1));
        userBattle.setSpell((int) (userBattle.getSpell() + userBO.getUserOriginBattle().getSpell() * 0.1));
        userBattle.setDef((int) (userBattle.getDef() + userBO.getUserOriginBattle().getDef() * 0.1));
        userBattle.setRes((int) (userBattle.getRes() + userBO.getUserOriginBattle().getRes() * 0.1));
        userBattle.setImm((int) (userBattle.getImm() + userBO.getUserOriginBattle().getImm() * 0.1));
        userBattle.setSpd((int) (userBattle.getSpd() + userBO.getUserOriginBattle().getSpd() * 0.1));
    }
}
